from ultralytics import YOLO

model = YOLO("best.pt")
results = model(r"E:\PycharmProjects\lincode\screenshot\001.png")
print(results[0].boxes.cls)
print(results[0].names)